home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / com / makingwaves / commands / SelectAllCommand.as < prev    next >
Text File  |  2009-12-16  |  992b  |  33 lines

  1. package com.makingwaves.commands
  2. {
  3.    import com.adobe.cairngorm.commands.Command;
  4.    import com.adobe.cairngorm.control.CairngormEvent;
  5.    import com.makingwaves.logic.RecipeFactory;
  6.    import com.makingwaves.model.ModelLocator;
  7.    import com.makingwaves.sql.DatabaseManager;
  8.    import com.makingwaves.vo.Recipe;
  9.    import mx.collections.ArrayCollection;
  10.    
  11.    public class SelectAllCommand implements Command
  12.    {
  13.        
  14.       
  15.       public function SelectAllCommand()
  16.       {
  17.          super();
  18.       }
  19.       
  20.       public function execute(param1:CairngormEvent) : void
  21.       {
  22.          var _loc4_:Recipe = null;
  23.          var _loc2_:ModelLocator = ModelLocator.getInstance();
  24.          _loc2_.recipes = new ArrayCollection();
  25.          var _loc3_:ArrayCollection = RecipeFactory.createRecipes(DatabaseManager.getInstance().getAllRecipes());
  26.          for each(_loc4_ in _loc3_)
  27.          {
  28.             _loc2_.recipes.addItem(_loc4_);
  29.          }
  30.       }
  31.    }
  32. }
  33.